package abstractEntities;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;

import entities.Course;
import entities.Language;
import entitiesIds.LanguagecourseId;

/**
 * AbstractLanguagecourse entity provides the base persistence definition of the
 * Languagecourse entity. @author MyEclipse Persistence Tools
 */
@MappedSuperclass
public abstract class AbstractLanguagecourse implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = 2164499918683805520L;
	private LanguagecourseId id;
	private Course course;
	private Language language;
	private String courseName;
	private String courseDescription;

	// Constructors

	/** default constructor */
	public AbstractLanguagecourse() {
	}

	/** full constructor */
	public AbstractLanguagecourse(LanguagecourseId id, Course course,
			Language language, String courseName, String courseDescription) {
		this.id = id;
		this.course = course;
		this.language = language;
		this.courseName = courseName;
		this.courseDescription = courseDescription;
	}

	// Property accessors
	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "idCourse", column = @Column(name = "idCourse", nullable = false)),
			@AttributeOverride(name = "abb", column = @Column(name = "abb", nullable = false, length = 5)) })
	public LanguagecourseId getId() {
		return this.id;
	}

	public void setId(LanguagecourseId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idCourse", nullable = false, insertable = false, updatable = false)
	public Course getCourse() {
		return this.course;
	}

	public void setCourse(Course course) {
		this.course = course;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "abb", nullable = false, insertable = false, updatable = false)
	public Language getLanguage() {
		return this.language;
	}

	public void setLanguage(Language language) {
		this.language = language;
	}

	@Column(name = "courseName", nullable = false)
	public String getCourseName() {
		return this.courseName;
	}

	public void setCourseName(String courseName) {
		this.courseName = courseName;
	}

	@Column(name = "courseDescription", nullable = false, length = 1500)
	public String getCourseDescription() {
		return this.courseDescription;
	}

	public void setCourseDescription(String courseDescription) {
		this.courseDescription = courseDescription;
	}

}